home *** CD-ROM | disk | FTP | other *** search
/ Shocking The Web CD-ROM / SHOCK_CD.ISO / pc / powerapp / animator.exe / ANIMATOR.DXR / 00052_Menu Engine.ls < prev    next >
Encoding:
Text File  |  1996-05-07  |  1.4 KB  |  48 lines

  1. property pFieldName, pSpecOrText, pCheckMark, pMenu
  2. global gMenuObjects, gMenuPick, gDisplaySize
  3.  
  4. on birth me, arguments
  5.   set the pFieldName of me to the fieldName of arguments
  6.   set the pSpecOrText of me to the specOrText of arguments
  7.   set the pCheckMark of me to the checkMark of arguments
  8.   set popupText to field the fieldName of arguments
  9.   set menuInstance to popup(mnew, popupText)
  10.   set the pMenu of me to menuInstance
  11.   if the machineType = 256 then
  12.     menuInstance(mRegister, "PPXW200-1375967771")
  13.   else
  14.     menuInstance(mRegister, "PPXM200-3953797641")
  15.     menuInstance(mSetAutoMark, the pCheckMark of me)
  16.   end if
  17.   return me
  18. end
  19.  
  20. on menuMouseDown me
  21.   set whichMenu to the pMenu of me
  22.   if the pSpecOrText of me = "spec" then
  23.     set gMenuPick to whichMenu(mPopupSpec, the left of sprite the clickOn, the bottom of sprite the clickOn)
  24.   else
  25.     set gMenuPick to whichMenu(mPopupText, the left of sprite the clickOn, the bottom of sprite the clickOn)
  26.   end if
  27.   if gMenuPick > 0 then
  28.     put line value(gMenuPick) of field the pFieldName of me into field "MenuChoice"
  29.     set gDisplaySize to gMenuPick
  30.     showDisplaySize()
  31.   end if
  32. end
  33.  
  34. on menuGetMenuInstance me
  35.   set whichMenu to the pMenu of me
  36.   return whichMenu
  37. end
  38.  
  39. on addUnique theList, theItem
  40.   if getOne(theList, theItem) = 0 then
  41.     add(theList, theItem)
  42.   end if
  43. end
  44.  
  45. on death me
  46.   deleteProp(gMenuObjects, the pFieldName of me)
  47. end
  48.